1. Field of the Invention
The present invention relates generally to graphics information processing, and in particular to methods and mechanisms for normalizing pixel component values.
2. Description of the Related Art
Computing devices with displays usually include different types of graphics functionality to manipulate and display video and images. Graphics hardware and software can perform many different types of operations to generate and process images intended for a display. One common type of operation is a pixel normalization operation. Pixel normalization is often performed to convert pixel values into a range from 0.0 to 1.0. Normalization is often performed prior to a color space conversion on the pixel data from a first color space to a second color space. A color space may be defined as a mathematical representation of a set of colors.
Typically, pixel normalization introduces a small error into the normalized pixel value. For example, if an 8-bit value is used to represent a pixel color, the value is in a range from 0 to 255. The maximum value of 255 is used to represent full color intensity, which should correspond to a normalized value of 1.0. However, in a typical graphics processing system, the 8-bit pixel value is normalized by dividing by 256. Therefore, the full color value of 255 does not get converted to a normalized value of 1.0, but instead becomes 255/256 (or 0.99609375).
Referring now to FIG. 1, a normalization of pixel values performed by a prior art normalization unit is shown. The input pixel values processed by normalization unit 10 may be N-bit values, and the input pixel values range from 0 to (2N−1), with a step size of 1. Normalization unit 10 normalizes the input values by dividing each input pixel value by 2N, which results in a range of normalized values from 0 to (2N−1)/2N, with a step size of ½N. However, in the input pixel representation, a value of (2N−1) represents a full color intensity value of 1.0 on a normalized scale, and so an error is introduced in the normalization process implemented by normalization unit 10. As is shown in FIG. 1, the input pixel component value range does not map to a normalized value of 1.0.
As long as only linear functions are utilized to process and/or manipulate values normalized by unit 10, then this error introduced by the normalization process may be corrected for at a later point by applying a correction factor. However, if a non-linear function were applied to the values generated by unit 10, then the normalization errors would be irreversible.